package com.info.widgets.Schedulebackup;

import java.util.ArrayList;
import java.util.List;
import java.sql.*;

import com.info.widgets.ConnectionHelper;
import com.info.widgets.DAOException;
import com.info.widgets.FeedBack.FeedBack;
import com.info.widgets.Schedulebackup.Schedulebackup;
public class SchedulebackupService {
	
	public ArrayList<Schedulebackup> scheduleCreation(Schedulebackup backup) throws DAOException{
		System.out.println("scheduleCreation");
		Schedulebackup backup1= new Schedulebackup();
		
		Connection con=null;
		String dbtime=null;
		//String query="SELECT * FROM mycaspian.schedule_backup";
		ArrayList<Schedulebackup> arrayList = new ArrayList<Schedulebackup>();
		try {
			con=ConnectionHelper.getConnection();
			Statement stmt=con.createStatement();
			//ResultSet rs=stmt.executeQuery(query);
			PreparedStatement pst = null;
			pst= con.prepareStatement("INSERT INTO Schedulebackup (now, time, onetimeonly, date, daily, weekly, montly) VALUES(?, ?, ?, ?, ?, ?, ?)");
			
			
			pst.setLong(2, backup.getTime());
			pst.setLong(4,backup.getDate());
			
	
	
	
			
		} catch (Exception e) {
			e.printStackTrace();
			throw new DAOException(e);
			
		}finally {
			ConnectionHelper.close(con);
			
		}
		 return arrayList;
		
		
		
	}
}